<?php

namespace App\Models\Company;

use App\Models\System\Region;
use Illuminate\Database\Eloquent\Model;

class Archive extends Model
{
    protected $table = 'company_archives';

    protected $fillable = [
        'name',
        'media_id',
        'region_id',
        'type',
        'business_scope',
        'location',
        'credit_code',
        'legal_person',
        'established_at',
        'capital',
        'email',
        'tel',
        'more_tel',
        'website',
        'task_id',
        'is_state',
        'is_top',
        'label_id'
    ];

    protected $casts = [
        'is_state' => 'boolean',
        'is_top' => 'boolean'
    ];

    public function region()
    {
        return $this->hasOne(Region::class, 'id', 'region_id');
    }
}
